const knowledge = {
	data() {
		return {
			knowledgeData: {} ,// 知识点数据
			isKnowledgeLayerShow: false, // 知识点layer是否展示
			showKnowPart: false, // 是否显示知识点片段
			knowLeftPercent: 0,
			knowPartPercent: 0
		}
	},
	methods: {
		getKnowledgeData (params, callback) {
			try {
				this.$refs.CCView.getKnowledgeData(params, callback)
			} catch (e) {
				console.log(e)
			}
		},
		onGetKnowledge (e) {
			console.log('android get knowledge:', this.videoId, e);
			this.knowledgeData = e.detail;
		},
		hideKnowledgeLayer() {
			this.isKnowledgeLayerShow = false;
			this.isControlBarShow = true;
		},
		handleViewPoint(starTime, endTime) {
			this.seekTo(starTime);
			this.start();
			if (endTime) {
				this.knowLeftPercent = starTime / this.totalTime;
				this.knowPartPercent = (endTime - starTime) / this.totalTime;
				this.showKnowPart = true;
			} else {
				this.showKnowPart = false;
			}
			// this.hideKnowledgeLayer();
		},
		handlePartEndPlayStatus(flag) {
			this.showKnowPart = false;
			if(flag) {
				this.pause();
			} else {
				this.start();
			}
		},
		resetKnowledge() {
			this.knowledgeData = {};
			this.showKnowPart = false;
		}
	}
}
export default knowledge